<%= content_for :css do %>
	<%= stylesheet_link_tag '/assets/all_events'%>
	<style>

		#mainContent{height: <%= 200+[(@events.count)*160,(@dates.count)*38].max %>px;}

	</style>
<% end %>

<div id="orinfo"> <%= link_to 'Home', root_path %> > All Events </div>

<h1>All Events</h1>

<ul class="monthSelector">
	<% @dates.each do |d| %>
		<li>
			<button>
			<%= link_to d, events_all_path(date: d)%>
			</button>
		</li>
	<% end %>
</ul>

<% if @is_there_prev_date %>
	<button id="prevBut">
	<%= link_to 'prev', events_all_path(date: @prev_date)%>
	</button>
<% else %>
	<button id="prevBut" style="visibility:hidden">
	</button>
<% end %>
<h1 class="month"> <%= @selected_date %> </h1>
<% if @is_there_next_date %>
	<button id="nextBut">
	<%= link_to 'next', events_all_path(date: @next_date)%>
	</button>
<% end %>


<div class="events">
	<% if @events.size() == 0%>
	<p style="margin:50px auto 0 auto; width:165px;">No events this month.</p>
	<% else %>
	<ul class="script">
		<% @events.each do |event| %>
			<li datetime="<%= event.date %>" class="disabled ">
				<%= link_to event_path(event) do %>
					<%= image_tag event.preview_img_src %><br>
					<%= event.name %>
				<% end %>
			</li>
		<% end %>
	</ul>
	<% end %>
</div>
